using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
using WoogiWorld.Event;

public struct TestData
{
    public string a;
    public int b;
    public bool c;
}

public class UICtr : MonoBehaviour
{
    public Text lable;
    public GameObject target;
    public Button btn;


    void Start()
    {
        btn.onClick.AddListener(() =>
        {
            target.SetActive(!target.activeSelf);
            lable.text = $"EventTrigger:{target.activeSelf}";
        });
    }

    // Update is called once per frame
    void Update()
    {
        UnityEngine.Profiling.Profiler.BeginSample("call 1");
        EventDispatcher.Instance.DispatchEvent(54523);
        UnityEngine.Profiling.Profiler.EndSample();

        UnityEngine.Profiling.Profiler.BeginSample("call 2");

        Test(123);
        UnityEngine.Profiling.Profiler.EndSample();
    }

    void Test<T>(T eventType, params object[] data)
    {
        UnityEngine.Profiling.Profiler.BeginSample("Test 1");
        Type t = eventType.GetType();
        UnityEngine.Profiling.Profiler.EndSample();
        
        UnityEngine.Profiling.Profiler.BeginSample("Test 2");
        Type t1 = typeof(T);
        if (t == typeof(string))
        {
            
        }
        UnityEngine.Profiling.Profiler.EndSample();
    }
}